package com.example.cymjoe.huaweishopping.adapter;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by cymjoe on 2016/12/5.
 */
public class MyAdapter extends FragmentPagerAdapter {
    private List<Fragment>data;
    private Context context;

    public MyAdapter(FragmentManager fm, List<Fragment> data, Context context) {
        super(fm);
        this.data = data;
        this.context = context;
    }

    public MyAdapter(FragmentManager fm) {
        super(fm);
        // TODO Auto-generated constructor stub
    }

    @Override
    public Fragment getItem(int arg0) {
        // TODO Auto-generated method stub
        return data.get(arg0);
    }

    @Override
    public int getCount() {
        // TODO Auto-generated method stub
        return data!= null?data.size():0;
    }
}
